package com.stxy.solar;

import java.awt.Graphics;
import java.awt.Image;

import com.stxy.util.Constant;
import com.stxy.util.GameUtil;
import com.stxy.util.MyFrame;

/**
 * 太阳系的主窗口
 * 
 * @author dell
 * 
 */
public class SolarFrame extends MyFrame {
	Image bg = GameUtil.getImage("images/bg.jpg");
	Star sun = new Star("images/sun.jpg", Constant.GAME_WIDTH / 2,
			Constant.GAME_HEIGHT / 2);
	Planet mercury = new Planet(sun, "images/Mercury.jpg", 40, 30, 0.1); // 水星 1
	Planet venus = new Planet(sun, "images/Venus.jpg", 90, 60, 0.08); // 金星 2
	Planet earth = new Planet(sun, "images/earth.jpg", 140, 90, 0.06); // 地球3
	Planet mars = new Planet(sun, "images/Mars.jpg", 190, 120, 0.04); // 火星4
	Planet jupiter = new Planet(sun, "images/Jupiter.jpg", 240, 150, 0.03); // 木星5
	Planet saturn = new Planet(sun, "images/Saturn.jpg", 290, 180, 0.02); // 土星6
	Planet uranus = new Planet(sun, "images/Uranus.jpg", 340, 210, 0.01); // 天王星7
	Planet neptune = new Planet(sun, "images/Neptune.jpg", 390, 240, 0.009); // 海王星8
	Planet moon = new Planet(earth, "images/moon.jpg", 30, 20, 0.2, true); // 月亮
	Planet moonM = new Planet(mars, "images/moon.jpg", 30, 20, 0.25, true); // 火星卫星


	public void paint(Graphics g) {
		g.drawImage(bg, 0, 0, null);
		sun.draw(g);
		mercury.draw(g);
		venus.draw(g);
		earth.draw(g);
		mars.draw(g);
		jupiter.draw(g);
		saturn.draw(g);
		uranus.draw(g);
		neptune.draw(g);
		moon.draw(g);
		moonM.draw(g);
	}

	public static void main(String[] args) {
		new SolarFrame().launchFrame();
	}
}
